package com.biz.primus.ms.member.dao.po;

import com.biz.primus.ms.base.jpa.converter.SetLongConverter;
import com.biz.primus.ms.base.jpa.po.BaseEntityPKIncrement;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Set;

/**
 * 会员标签
 *
 * @author jun.liu
 * @date 2017年10月22日
 * @reviewer
 * @see
 */
@Entity
@Table(name = "member_label")
@Data
@EqualsAndHashCode(callSuper = true)
public class MemberLabel extends BaseEntityPKIncrement
{

    /**
     * 标签名称
     */
    @Column(name = "name", length = 32, nullable = false, unique = true)
    private String name;

    /**
     * 备注说明
     */
    @Column(name = "remaks", length = 100)
    private String remaks;

    /**
     * 标签类型
     * 引用MemberLabelType对象
     */
    @Column
    private Long memberLabelTypeId;

    /**
     * 标签所拥有的会员id集合
     */
    @Convert(converter = SetLongConverter.class)
    @Column(columnDefinition = "TEXT")
    private Set<Long> memberIds;
}
